//package com.wss.lsl.test.driven.learning;
//
//import java.io.IOException;
//import java.io.PrintWriter;
//import java.util.ArrayList;
//import java.util.List;
//
//
//import com.sun.mirror.apt.AnnotationProcessor;
//import com.sun.mirror.apt.AnnotationProcessorEnvironment;
//import com.sun.mirror.declaration.MethodDeclaration;
//import com.sun.mirror.declaration.ParameterDeclaration;
//import com.sun.mirror.declaration.TypeDeclaration;
//import com.sun.mirror.declaration.Modifier;
//
//
//@SuppressWarnings({ "deprecation", "restriction" })
//public class ExtractInterfaceProcess implements AnnotationProcessor {
//
//	private AnnotationProcessorEnvironment env;
//
//	@Override
//	public void process() {
//		System.out.println("process");
//		for (TypeDeclaration typeDecl : env.getSpecifiedTypeDeclarations()) {
//			ExtractInterface annot = typeDecl.getAnnotation(ExtractInterface.class);
//			if(annot == null) {
//				continue;
//			}
//			
//			System.out.println("found ExtractInterface");
//			List<MethodDeclaration> methods = new ArrayList<MethodDeclaration>();
//			for (MethodDeclaration method :  typeDecl.getMethods()) {
//				System.out.println(method.getModifiers());
//				if(method.getModifiers().contains(Modifier.PUBLIC) &&
//						!method.getModifiers().contains(Modifier.STATIC)) {
//					methods.add(method);
//				}
//			}
//			if(methods.isEmpty()) {
//				continue;
//			}
//			
//			try {
//				System.out.println(annot.value());
//				PrintWriter out = env.getFiler().createSourceFile(annot.value());
//				out.println("package " + typeDecl.getPackage().getQualifiedName() + ";");
//				out.println("public interface " + annot.value() + "{");
//				
//				for(MethodDeclaration methodDecl : methods) {
//					out.print(methodDecl.getReturnType() + " ");
//					out.print(methodDecl.getSimpleName() + " (");
//					int i = 0;
//					for(ParameterDeclaration pd : methodDecl.getParameters()) {
//						out.print(pd.getType() + " " + pd.getSimpleName());
//						if(++i < methodDecl.getParameters().size()) {
//							out.print(", ");
//						}
//					}
//					out.print(");");
//					out.println();
//				}
//				
//				out.println("}");
//			} catch (IOException e) {
//				e.printStackTrace();
//			}
//			
//		}
//	}
//
//	public ExtractInterfaceProcess(AnnotationProcessorEnvironment env) {
//		this.env = env;
//	}
//
//}
